package com.aloda.ojcommon.context;

import com.aloda.ojcommon.domain.dto.UserCacheDTO;

/**
 * @Author aloda
 * @Date 2025/4/25 8:40
 */
public class UserBaseContext {

    private static final ThreadLocal<UserCacheDTO> tl = new ThreadLocal<>();

    public static void saveUser(UserCacheDTO userCacheDTO){
        tl.set(userCacheDTO);
    }

    public static UserCacheDTO getUser(){
        return tl.get();
    }

    public static void removeUser(){
        tl.remove();
    }
}
